<?php  if (!defined("IS_INITPHP")) exit("Access Denied!");  /* INITPHP Version 1.0 ,Create on 2016-08-31 22:02:44, compiled from D:\chendeben\zendwork\kabasi/app/template/kabasi/manage/news/add.html */ ?>

<!-- SELECT2 EXAMPLE -->
<div class="box box-default">
	<div class="box-header with-border">
		<h3 class="box-title">添加文章</h3>
	</div>
	<!-- /.box-header -->
	<div class="box-body">
		<div class="row">
			<div class="col-md-11">
				<form class="form-horizontal" action="/manage/news/save" method="post" name="myform" id="myform">
					<div class="form-group">
						<label class="col-md-2 non-rpad control-label" for="title">文章标题：</label>
						<div class="col-md-6 non-lrpad" style="line-height: 24px">
							<input type="text" required name="title" id="title" class="form-control" value="<?php echo $data['title'];?>" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 non-rpad control-label" for="pid">所属分类：</label>
						<div class="col-md-2 non-lrpad" style="line-height: 24px">
							<select name="pid" class="form-control">
								<?php foreach ($cat as $k=>$v) { ?>
								<option value="<?php echo $k;?>" <?php  if($data['pid']==$k){echo "selected";} ?>><?php echo $v;?></option>
								<?php } ?>
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 non-rpad control-label" for="seo_title">SEO标题：</label>
						<div class="col-md-6 non-lrpad" style="line-height: 24px">
							<input type="text" required name="seo_title" id="seo_title" class="form-control" value="<?php echo $data['seo_title'];?>" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 non-rpad control-label" for="keyword">keyword：</label>
						<div class="col-md-6 non-lrpad" style="line-height: 24px">
							<input type="text" required name="keyword" id="keyword" class="form-control" value="<?php echo $data['keyword'];?>" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 non-rpad control-label" for="descript">description：</label>
						<div class="col-md-6 non-lrpad" style="line-height: 24px">
							<input type="text" name="descript" id="descript" class="form-control" value="<?php echo $data['descript'];?>" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-md-2 non-rpad control-label" for="content">内容：</label>
						<div class="col-md-10 non-lrpad" style="line-height: 24px">
							<script id="container" name="content"><?php echo $data['content'];?></script>
						</div>
					</div>
					<div class="form-group">
							<label class="col-md-2 non-rpad control-label" for="update_time"> 更新时间 ：</label>
							<div class="col-md-3 non-lrpad">
								<input class="setdate form-control" type="text" name="update_time" id="update_time" value="<?php echo $data['update_time']?date('Y-m-d H:i:s',$data['update_time']):date('Y-m-d H:i:s') ?>" /> 
							</div>
						</div>
						<div class="form-group">
							<label class="col-md-2 non-rpad control-label" for="public_time"> 定时时间 ：</label>
							<div class="col-md-3 non-lrpad">
								<input class="setdate form-control" type="text" name="public_time" id="public_time" value="<?php echo $data['public_time']?date('Y-m-d H:i:s',$data['public_time']):date('Y-m-d H:i:s') ?>" />
								选择未来的时间即可定时发布 
							</div>
						</div>
					<div class="form-group">
						<label class="col-md-2 non-rpad control-label" for="sort">排序：</label>
						<div class="col-md-6 non-lrpad" style="line-height: 24px">
							<input type="text" required name="sort" id="sort" class="form-control" value="<?php echo $data['sort'];?>" />
						</div>
					</div>
					<div class="form-group">
					<?php if ($id) { ?>
					<input type="hidden" name="id" value="<?php echo $id;?>">
					<?php } ?>
						<input class="col-md-2 col-md-offset-5 btn btn-success" type="submit" value="提交" />
					</div>
				</form>
			</div>

		</div>
		<!-- /.row -->
	</div>
	<!-- /.box-body -->
</div>
<!-- /.box -->
<script src="/static/js/WdatePicker.js"></script>
<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
	<script type="text/javascript" src="/ueditor/ueditor.all.js"></script>
	<script type="text/javascript">
		var ue = UE.getEditor('container', {
			initialFrameHeight : 500,
		});
		$(document).ready(function() {
			$(".setdate").click(function() {
				var old_val=$(this).val();
				WdatePicker({
					dateFmt : 'yyyy-MM-dd HH:mm:ss',
				});
			});
			
		});
		</script>